#include<iostream>

using namespace std;



int main()
{
    int T;
    cin >> T;
    while (T--)
    {
        int temp[10] = { 0 };
        for (int i = 0; i < 12; i++)
        {
            int num;
            cin >> num;
            temp[num] += 1;
        }
        int x, y;
        cin >> x >> y;
        if (temp[y] < x)
        {
            cout << "win" << endl;
        }
        else
        {
            cout << "lose" << endl;
        }
    }
    return 0;
}